Alibabacloud.com offers a wide variety of articles about getelementsbytagname example, easily find your getelementsbytagname example information here online.
Getelementbyid getelementsbyname getelementsbytagname difference and summary
1st Floor
Getelementbyid getelementsbyname getelementsbytagname difference and summaryIn the Web standard, you can use getelementbyid (), getelementsbyname (),
Document directory
Syntax
Description
Example 1
Example 2
Example 3
Definition and usage
The getelementsbytagname () method returns a set of objects with the specified tag name.Syntax
document.getElementsByTagName(tagname)Description
The
function tag (Name,elem) {if (!document.getelementsbytagname) return false;Return (Elem | | document). getElementsByTagName (name);}
document.getelementsbyclassname = function (Classname,obox) {
Applies to getting all HTML elements
getElementById () and getElementsByTagName () one is the ID and the other is name what is the difference between them, getElementById () only for HTML operations and not the XML file processing, But getElementsByTagName is OK. Let's take a look at
Getelementbyid () getelementsbyname () getelementsbytagname ()
DifferenceIn the Web standard, you can use getelementbyid (), getelementsbyname (), and getelementsbytagname () to access any tag in javasnent:
1 getelementbyid ("ID ")Getelementbyid ()
Web
Standard
Getelementbyid (), getelementsbyname (), and getelementsbytagname ()
Access
Billing NENT
Any tag in:
1 getelementbyid ("ID ")
Getelementbyid ()
Accessible
Billing NENT
A specific element in
ID
So you can only
Web
Standard
Getelementbyid (), getelementsbyname (), and getelementsbytagname ()
Access
Billing NENT
Any tag in:
1. getelementbyid ("ID ")
Getelementbyid ()
Accessible
Billing NENT
A specific element in
ID
So you can only
Document. form name. object Name. attribute values may not be supported by third parties in this way. We recommend that you use the getelementbyid (), getelementsbyname (), and getelementsbytagname () methods () the result is an array.On the
Getelementbyid getelementsbyname getelementsbytagnameKnowledge needs to be updated and new, and those you have read will also be forgotten. You need to consolidate it. ^_^In the Web standard, you can use getelementbyid (), getelementsbyname (), and
In the Web standard, you can use getelementbyid (), getelementsbyname (), and getelementsbytagname () to access any tag in the document.
(1) getelementbyid ():
Getelementbyid () can access a specific element in the document. As the name suggests,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.